{include file="public/header" /}
<style>
    h2 {
        text-align: center;
    }
    hr {
        border-top: 20px solid #eee
    }
    .navtop{
        position: sticky;
        top: 20px;
        z-index: 999;
    }
    .navtop li {
        display: block;
        line-height: 24px;
        text-align: right;
        color: #4da3fb;
    }
    .navtop li:hover{
        background: #fff;
        padding-right: 20px;
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content {:config('adminClass.main')}">
    <div class="row">
        <div class="col-sm-12">
            {include file="public/tophead"}
            {include file="public/top" /}
            <div class="ibox-content">
                {include file="public/topsection"}

                <form class="form-horizontal" method="post">
                <div class="tabs-container">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">活动名称：</label>
                        <div class="col-sm-9">
                            <input type="text" name="name" class="form-control" value="{$data.name}">
                            <span class="help-block m-b-none" style="color:rgba(0,0,0,0.4)"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">活动时间：</label>
                        <div class="col-sm-2">
                        <input type="datetime" id="start" name="starttime" class="form-control" value="{$data.starttime}">
                        </div>
                        <div class="col-sm-2">
                        <input type="datetime" id="end" name="endtime" class="form-control" value="{$data.endtime}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">折扣%：</label>
                        <div class="col-sm-9">
                            <input type="number" name="discount" class="form-control" value="{:floatval($data.discount)}">
                            <span class="help-block m-b-none" style="color:rgba(0,0,0,0.4)">如填写88则折扣为88%</span>
                        </div>
                    </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">活动描述：</label>
                            <div class="col-sm-9">
                                <textarea class="form-control" name="description" rows="4">{$data.description}</textarea>
                            </div>
                        </div>
                </div>
                </form>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
{load href="__PLUGINS__iCheck/icheck.min.js"}
{load href="__PLUGINS__iCheck/custom.css"}
<script type="text/javascript">
    layui.use(['laydate'], function(){
        var laydate = layui.laydate;

       //开始时间时间
        var start = laydate.render({
            elem: '#start',
            type: 'datetime',
            min: '1900-1-1 00:00:00',
            max: '2099-6-16 23:59:59',
            trigger: 'click', //采用click弹出
            done: function (value, date, endDate) {
                end.config.min = {
                    year: date.year,
                    month: date.month - 1,
                    date: date.date,
                    hours: date.hours,
                    minutes: date.minutes,
                    seconds: date.seconds
                }; //开始日选好后，重置结束日的最小日期
                end.config.value = {
                    year: date.year,
                    month: date.month - 1,
                    date: date.date,
                    hours: date.hours,
                    minutes: date.minutes,
                    seconds: date.seconds
                }; //将结束日的初始值设定为开始日
            }
        });

        //结束时间
        var end = laydate.render({
            elem: '#end',
            type: 'datetime',
            min: '1900-1-1 00:00:00',
            max: '2099-6-16 23:59:59',
            trigger: 'click', //采用click弹出
            done: function (value, date, endDate) {
                start.config.max = {
                    year: date.year,
                    month: date.month - 1,
                    date: date.date,
                    hours: date.hours,
                    minutes: date.minutes,
                    seconds: date.seconds
                }; //结束日选好后，重置开始日的最大日期
            }
        });
    })


</script>
{include file="public/bottom" /}
